<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\Jobs\IEC104Job;

/**
 * 从电厂获取南瑞数据并保存到本地
 */
class IEC104Cmd extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'collect:iec104';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'collect:iec104';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        $params = array(
            'conn' => 'sqlsrv—local',
            'table' => 'nari_yongqiang1'
        );
        dispatch(new IEC104Job($params));

        return 0;
    }
}
